<template>
    <div>
    <el-dialog title="新增图书" :visible="visible">
    <div><span>图书名称：</span>
    <el-input class="elinput" v-model="data.btitle"></el-input>
    </div>
    <div><span>发布日期：</span>
    <el-input class="elinput" v-model="data.bpub_date"></el-input>
    </div>
    <div><span>阅读量：</span>
    <el-input class="elinput" v-model="data.bread"></el-input>
    </div>
    <div><span>评论量：</span>
    <el-input class="elinput" v-model="data.bcomment"></el-input>
    </div>
    <el-button @click="cancel">取 消</el-button>
    <el-button type="primary" @click="addBook">确 定</el-button>
    </el-dialog>
    </div>
</template>

<script>
export default {
props:['data','visible'],
data() {
    return {
        
    }
},
methods: {
    addBook(){
        this.$emit("update:visible",false)
        this.$emit("save")
    },
    cancel(){
        this.$emit('update:visible',false)
    }
},
}
</script>

<style>

.elinput {
  width: 220px;
  height: 40px;
}
</style>
